<div class="modal fade" id="content-dlg">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" style="font-size: 16px;">提现申请单</h4>
            </div>
            <div class="modal-body" id="content-body">
                <div class="row input-row">
                    <table class="detail">
                        <tr>
                            <td>编号：</td>
                            <td id="no"></td>
                        </tr>
                        <tr>
                            <td>钱包类型：</td>
                            <td id="wallet"></td>
                        </tr>
                        <tr>
                            <td>提现金额：</td>
                            <td id="money"></td>
                        </tr>
                        <tr>
                            <td>提现手续费：</td>
                            <td id="tax_money"></td>
                        </tr>
                        <tr>
                            <td>实际到账：</td>
                            <td id="ok_money"></td>
                        </tr>
                        <tr>
                            <td>信息备注：</td>
                            <td id="remark"></td>
                        </tr>
                        <tr>
                            <td>提现方式：</td>
                            <td id="type"></td>
                        </tr>
                        <tr>
                            <td>收款账户信息：</td>
                            <td id="account" class="red"></td>
                        </tr>
                        <tr>
                            <td>状态：</td>
                            <td id="status"></td>
                        </tr>
                        <tr>
                            <td>申请时间：</td>
                            <td id="create_time"></td>
                        </tr>
                        <tr>
                            <td>处理时间：</td>
                            <td id="deal_time"></td>
                        </tr>
                        <tr>
                            <td>处理结果：</td>
                            <td id="result"></td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
    function withdrawDlg(log) {
        console.log(log);
        $("#no").html(log.no);
        $("#wallet").html(uWalletStr(log.wallet));
        $("#money").html(log.money);
        $("#tax_money").html(log.tax_money);
        $("#ok_money").html(log.ok_money);
        $("#remark").html(log.remark == '' ? '无' : log.remark);
        $("#type").html(uPayWayStr(log.type));
        $("#account").html(account(log));
        $("#status").html(statusStr(log.status));
        $("#create_time").html(new Date(parseInt(log.create_time) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' '));
        $("#deal_time").html(log.deal_time == null ? '暂无' : new Date(parseInt(log.deal_time) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' '));
        $("#result").html(log.result == null ? '暂无' : log.result);

        $("#content-dlg").modal();
    }

    function uWalletStr(w) {
        if (w == "{{\App\Models\MWallet::$WALLET_TYPE_1}}") {
            return "奖金币";
        } else if (w == "{{\App\Models\MWallet::$WALLET_TYPE_2}}") {
            return "报单币";
        } else if (w == "{{\App\Models\MWallet::$WALLET_TYPE_3}}") {
            return "购物币";
        } else if (w == "{{\App\Models\MWallet::$WALLET_TYPE_4}}") {
            return "重消积分";
        } else if (w == "{{\App\Models\MWallet::$WALLET_TYPE_5}}") {
            return "可用积分+可用余额";
        }
    }

    function uPayWayStr(w) {
        if (w == "{{\App\Models\MWithdrawLog::$PAY_TYPE_ZFB}}") {
            return "支付宝";
        } else if (w == "{{\App\Models\MWithdrawLog::$PAY_TYPE_WX}}") {
            return "微信";
        } else if (w == "{{\App\Models\MWithdrawLog::$PAY_TYPE_YHK}}") {
            return "银行卡";
        }
    }

    function statusStr(status) {
        if (status == 0) {
            return '<span class="blue">审核中</span>';
        } else if (status == 1) {
            return '<span class="green">已打款</span>';
        } else if (status == 2) {
            return '<span class="red">已拒绝</span>';
        }
    }

    function account(log) {
        if (log.type == "{{\App\Models\MWithdrawLog::$PAY_TYPE_ZFB}}") {
            return log.zfb + " " + log.tel;
        } else if (log.type == "{{\App\Models\MWithdrawLog::$PAY_TYPE_WX}}") {
            return log.wx + " " + log.tel;
        } else if (log.type == "{{\App\Models\MWithdrawLog::$PAY_TYPE_YHK}}") {
            return log.card_bank + "<br>" + log.card_no + "<br>" + log.card_name + "<br>" + log.tel;
        }
    }
</script>